package com.vteba.utils.charstr;

import java.nio.charset.Charset;

public class Char {
	public static final Charset GBK = Charset.forName("GBK");
	public static final Charset UTF8 = Charset.forName("UTF-8");
	public static final Charset ISO88591 = Charset.forName("ISO-8859-1");
	public static final Charset GB2312 = Charset.forName("GB2312");
	
    public static Charset toCharset(String charset) {
        return charset == null ? Charset.defaultCharset() : Charset.forName(charset);
    }
    
    public static Charset toCharset(Charset charset) {
        return charset == null ? Charset.defaultCharset() : charset;
    }
}
